package com.heima.kafka.listener;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaConsumerListener {

    @KafkaListener(topics = "kafka.topic")
    public void consumer(ConsumerRecord<String,String> record){
        String key = record.key();
        String value = record.value();

        System.out.println("group1中的消费者接收到的信息是：" + key + ":" + value);
    }
}
